IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[or_MentorTagSelect]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE dbo.[or_MentorTagSelect]
Go

CREATE  PROCEDURE  dbo.[or_MentorTagSelect]  
	@UserID  int
	--[or_MentorTagSelect] 7 

AS  
  
  declare @DateTime datetime,@TranCountAtEntry int
  select @DateTime = getdate() 
BEGIN TRY 

IF @TranCountAtEntry  = 0 
BEGIN TRANSACTION 


SELECT mt.MentorMatchTagID, mt.Name MentorMatchTagName
from dbo.UserMentorTag t
JOIN dbo.MentorMatchTag mt ON t.MentorMatchTagID = mt.MentorMatchTagID
where MeMaUserID = @UserID


 
IF @@TRANCOUNT > @TranCountAtEntry
COMMIT TRANSACTION

END TRY
BEGIN CATCH
  
  IF @@TRANCOUNT > @TranCountAtEntry
  ROLLBACK TRANSACTION

  -- Raise an error with the details of the exception
  or_raiseerror 

END CATCH
  
  